/********************************************/
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				ProjectGroupOptions.java
  //    Title   :			get the Project Name Data into a list box
  //	FUNCTION:
  //	BY:				Poly Li
  //	DATE:				14-01-2004
  // --------------------------------------------------------------
/*********************************************/

package tss.options;

import tss.common.Options2;
import java.util.ArrayList;
import java.sql.Connection;

import tss.projectgroup.*;

/**
 * A Class class.
 * <P>
 * @author HTHK
 */
public class ProjectGroupOptions
  extends Options2
{

  /**
   * Constructor
   */
  public ProjectGroupOptions() {
      this.load();
  }

  @Override
protected ArrayList createOptions(Connection con)
    throws Exception
  {
      ArrayList options = new ArrayList();
      ProjectGroupBean projectGroup = ProjectGroupProcess.createBean();
      projectGroup.setProject_name("");
      ProjectGroupBean[] projectGroups = ProjectGroupProcess.find(con,projectGroup);
      for (int i=0; i<projectGroups.length; i++)
      {
          Options2.Option option
          = new Options2.Option( projectGroups[i].getProject_name(),
                                projectGroups[i].getProject_name());
          options.add(i,option);
      }
      return options;
  }


}

